home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NeXTSTEP 3.1 (Developer) [x86]
/
NeXT Step 3.1 Intel dev.cdr.dmg
/
NextDeveloper
/
Examples
/
AppKit
/
Draw
/
textUndo.subproj
/
CutSelection.m
< prev
next >
Wrap
Text File
|
1992-02-09
|
940b
|
45 lines
#import "textundo.h"
@implementation CutSelection
/*
* The CutSelection class works like a normal TextSelection except that
* we maintain seperate variables for the visible start and end of the
* selection. This is handy when you want to save a block of characters,
* but when you install: the selection, you want the insertion point at
* the end. Use this class when the characters to be saved don't correspond
* directly to the characters to be shown in the selection.
*/
- initText:aView start:(int)aPos end:(int)anotherPos
{
[super initText:aView start:aPos end:anotherPos];
visibleStart = start;
visibleEnd = end;
return self;
}
- install
{
[super install];
[text setSel:visibleStart :visibleEnd];
return self;
}
- (int)visibleLength
{
return (visibleEnd - visibleStart);
}
- setVisible:(int)vStart :(int)vEnd
{
visibleStart = vStart;
visibleEnd = vEnd;
return self;
}
@end